home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 5 / DINKDEMO / DINKCLAS / DLISTSTU.H < prev    next >
Text File  |  1992-07-08  |  871b  |  62 lines

  1. /*
  2.     File:        DListStuff.h
  3.  
  4.     Written by:    Mark Gross
  5.  
  6.     Copyright:    ⌐ 1992 by Applied Technical Software, all rights reserved.
  7.     Use at your own risk.
  8.  
  9. */
  10.  
  11. #ifndef __DLISTSTUFF__
  12. #define __DLISTSTUFF__
  13. #include "DObject.h"
  14.  
  15.  
  16. class DLink
  17. {
  18. public:
  19.     
  20.     DLink*    fNext;
  21.     void*    fItem;
  22.     
  23.     
  24.     DLink*    Init(DLink *n, void *item);
  25.     DLink*    GetNext(void);
  26.     void*    GetItem(void);
  27.     void    SetNext(DLink* aLink);
  28.     void    SetItem(void* anItem);
  29. };// end of DLink class declaration
  30.  
  31.  
  32. class    DList    
  33. {
  34. public:
  35.     
  36.     DLink*    fLink;
  37.     
  38.     int        fNumItems;
  39.     
  40.     
  41.     DList*    Init(void);
  42.     void    AddItem(void* item);
  43.     Boolean    RemoveItem(void* item);
  44.     Boolean    ItemInList(void* item);
  45.     int        NumItems(void);
  46. };// end of DList class declaration
  47.  
  48.  
  49. class DIterator
  50. {
  51. public:
  52.     
  53.     DLink*    fCurLink;
  54.     
  55.     
  56.     DIterator*    Init(DList* list);
  57.     void*    GetCurrentThenIncrement(void);
  58. };// end of class declaration TIterator
  59.  
  60.  
  61.  
  62. #endif __DLISTSTUFF__